home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / dvglue10.arc / DVVER.C < prev    next >
C/C++ Source or Header  |  1988-08-13  |  1KB  |  46 lines

  1. /*====================================================*/
  2. /* DVVER.C                                            */
  3. /*                                                    */
  4. /* (c) Copyright 1988 Ralf Brown  All Rights Reserved */
  5. /* May be freely copied for noncommercial use,        */
  6. /* provided that this copyright notice remains intact */
  7. /* and any changes are clearly indicated in the       */
  8. /* comment blocks preceding functions                 */
  9. /*====================================================*/
  10.  
  11. #include "tvapi.h"
  12.  
  13. /*======================================================*/
  14. /* DVver--return DESQview version, -1 if not loaded     */
  15. /*   Ralf Brown 4/3/88                                  */
  16. /*======================================================*/
  17.  
  18. WORD pascal DVver(void)
  19. {
  20. #ifdef __TURBOC__
  21.    _AX = 0x2B01 ;
  22.    _CX = 0x4445 ;
  23.    _DX = 0x5351 ;
  24.    geninterrupt(0x21);
  25.    if (_AL == 0xFF)
  26.       return -1 ;
  27.    else if (_BX == 2)    /* early copies of 2.00 return 2 rather than 0x0200 */
  28.       return 0x0200 ;
  29.    else return _BX ;
  30. #else
  31.    union REGS regs ;
  32.  
  33.    regs.x.ax = 0x2B01 ;
  34.    regs.x.cx = 0x4445 ;
  35.    regs.x.dx = 0x5351 ;
  36.    int86(0x21,®s,®s) ;
  37.    if (regs.h.al == 0xFF)
  38.       return -1 ;
  39.    else if (regs.x.bx == 2)
  40.       return 0x0200 ;
  41.    else return regs.x.bx ;
  42. #endif __TURBOC__
  43. }
  44.  
  45. /* End of DVVER.C */
  46.